<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <canvas style="width: 1000px; height: 1000px;"></canvas>
    <script>
        var canvas = document.querySelector('canvas');
        var context = canvas.getContext('2d');
        //Y轴
        context.moveTo(100,10);
        context.lineTo(100,80);
        //X轴
        context.moveTo(100,80)
        context.lineTo(300,80)
        context.font = '12px 微软雅黑'
        context.strokeStyle = 'red'
        context.stroke()
        context.fillText('食品', 320,90)
       
        
    </script>
</body>

</html>